<%@page import="cdp.Cliente"%>
<%@page import="java.util.List"%>
<%@include file="inc/inicio.jsp" %>
<h1>Clientes cadastrados por periodo</h1>
<hr />
<p>
<form>
    selecione periodo:<br />
    <input type="hidden" name="evento" value="vendas" />
    inicio (yyyy-mm-dd):<input type="text" name="d1" value="<%=request.getParameter("d1")!=null?request.getParameter("d1"):""%>" /><br />
    fim (yyyy-mm-dd):<input type="text" name="d2" value="<%=request.getParameter("d2")!=null?request.getParameter("d2"):""%>" /><br />
    <input type="submit" value="buscar" />
</form>
</p>
<table border="1">
    <tr>
        <td>cliente</td>
        <td>email</td>
        <td>vip</td>
        <td>idade</td>
        <td>endereco</td>
        <td>data</td>
    </tr>
    <%
        List<Cliente> relatorios = (List<Cliente>)request.getAttribute("relatorio");
        if (relatorios != null) {
            for (Cliente r : relatorios) {
                out.print("<tr>");
                out.print("<td>" + r.getNome() + "</td>");
                out.print("<td>" + r.getEmail() + "</td>");
                out.print("<td>" + r.isVip() + "</td>");
                out.print("<td>" + r.getIdade() + "</td>");
                out.print("<td>" + r.getEndereco() + "</td>");
                out.print("<td>" + r.getDataCadastro() + "</td>");
                out.print("</tr>");
            }
        }
    %>
</table>
<%@include file="inc/fim.jsp" %>